<?php
	include_once("../model/Acesso.class.php");
	include_once("../model/Mensagem.class.php");
	include_once("../model/Cliente.class.php");
	include_once("../model/Fornecedor.class.php");
	include_once("../model/Entrada.Class.php");
	
	$acesso = new Acesso();
	$entrada = new Entrada();
	$fornecedor = new Fornecedor();
	$codigoPagina = "10";
	if ($acesso->verificaPermissaoUsuario($codigoPagina)){
		$banco = $acesso->getBanco();
?>
<html>
<head>
<title>:.:.:INGECAMP:.:.:</title>
<link href="../arquivosExtra/estilo.css" rel="stylesheet" type="text/css">
<script language="javascript" src="../arquivosExtra/funcoesJavaScript.js"></script> 
<style type="text/css">
	body{
		background-color:#FFFFFF;
		background-image:none;
	}
</style>
<script language="javascript" src="../arquivosExtra/funcoesJavaScript.js"></script>
</head>

<body topmargin="0" leftmargin="0" onLoad="filtrarEntradasData()">
<table width="100%" border="2" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="#CCCCCC" class="letraCabecalho">SIG-INGECAMP- Sistema de Gerenciamento Geral - INGECAMP - Via Internet</td>
  </tr>
  <tr>
    <td height="21" align="center" valign="top">
<table width="100%" border="0" cellspacing="0">
        <tr> 
          <td height="57" valign="bottom"><table width="100%" border="0" cellspacing="0">
              <tr> 
                <td height="26" colspan="5" align="center" class="letraCampo"><img src="../imagens/logo.jpg" width="569" height="96"></td>
              </tr>
              <tr> 
                <td height="22" valign="bottom">&nbsp;</td>
                <td colspan="2" valign="middle">&nbsp;</td>
                <td valign="middle">&nbsp;</td>
                <td valign="bottom">&nbsp;</td>
              </tr>
              <tr> 
                <td width="12%" height="39" valign="bottom">&nbsp;</td>
                <td width="61%" valign="middle"> <div align="right"> 
                    <input type="button" name="Submit2" value="Pagina Principal" class="botaoUsuario2" onClick="Redireciona()">
                  </div></td>
                <td width="2%" valign="middle">&nbsp;</td>
                <td width="11%" valign="middle"><div align="center"> 
                    <input type="button" name="Submit223" value="Logoff" class="botaoUsuario2" onClick="formLogoff()">
                  </div></td>
                <td width="14%" valign="bottom">&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table> 
      
      
      <form name="formAl" method="post" action="formAltEntrada.php">
        <input name="notas" id="notas" type="hidden" value="">
        <table width="965" height="147" border="2" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="23%" height="21" bgcolor="#CCCCCC" class="letraCabecalho"><div align="center" class="letraCabecalho">Selecao de Entrada no Estoque Para Alteracao</div></td>
          </tr>
          <tr>
            <td height="87" align="left" valign="top"><table width="100%" border="0">
                <tr>
                  <td height="24" align="right" valign="top"><table width="100%" border="0">
                      <tr>
                        <td height="18" align="center"><span class="letraCampo">Dados das Entradas </span></td>
                      </tr>
                  </table></td>
                </tr>
                <tr>
                  <td height="32" align="right" valign="top"><table width="100%" border="0">
                      <tr>
                        <td width="8%" height="21" align="right"><span class="letraCampo">De:</span></td>
                        <td width="10%"><input name="dataini" type="text" class="caixaTexto" id="dataini" onKeyPress="mascara(this, mdata)" size="15" maxlength="10" value="01/01/2010" onBlur="filtrarEntradasData()"></td>
                        <td width="4%" align="right" class="letraCampo">At&eacute;:</td>
                        <td width="10%"><input name="datafim" type="text" class="caixaTexto" id="datafim" onKeyPress="mascara(this, mdata)" size="15" maxlength="10" value="<?php $z = $acesso->getDataAcesso(); echo("$z"); ?>" onBlur="filtrarEntradasData()"></td>
                        <td width="12%" align="right" class="letraCampo"><label>Nota Fiscal:</label></td>
                        <td width="8%"><select name="nota" class="caixaTexto" id="nota" onChange="filtrarEntradasData()">
                          <option value="TODOS">TODOS</option>
                          <?php
                            $nota = $entrada->getAllEntradaNF($banco);
                            while($temp = mysql_fetch_row($nota)){
                                echo("<option value=\"$temp[3]\">$temp[3]</option>");
                            }
                          ?>
                                                                                                </select></td>
                        <td width="9%" align="right" class="letraCampo">Fornecedor:</td>
                        <td width="39%"><select name="fornecedor" class="caixaTexto" id="fornecedor" onChange="filtrarEntradasData()">
                          <option value="TODOS">TODOS</option>
                          <?php
                            $forne = $fornecedor->getAllFornecedor($banco);
                            while($temp = mysql_fetch_row($forne)){ 
                                echo("<option value=\"$temp[0]\">$temp[1]</option>");
                            }
                          ?>
                                                </select></td>
                      </tr>
                  </table></td>
                </tr>
                 <tr>
                  <td height="21" align="right" valign="top"><div id="conteiner"> </div></td>
                </tr>
                <tr>
                  <td height="21" align="right" valign="top">&nbsp;</td>
                </tr>
            </table></td>
          </tr>
          <tr>
            <td></td>
          </tr>
          <tr>
            <td height="37" align="left" valign="top"><div align="center">
                <table width="100%" border="0">
                  <tr>
                    <td align="right"><input type="submit" name="Submit3" value="Selecionar" class="botoes"></td>
                    <td>&nbsp;</td>
                    <td><input type="button" name="Submit3" value="Cancelar" class="botoes" onClick="Redireciona()"></td>
                  </tr>
                </table>
            </div></td>
          </tr>
        </table>
        <p>&nbsp;</p>
     </form>
      <p>&nbsp;</p>
  </tr>
  <tr>
    <td height="21" bgcolor="#CCCCCC"><table width="100%" border="0" cellspacing="0">
        <tr> 
           <td width="302" align="right"> 
            <input name="textfield" type="text" class="informacoesLogin" value="Usu&aacute;rio:  <?php $x = $acesso->getLoginUsuarioLogado(); echo("$x"); ?>" readonly="readonly"> 
          </td>
          <td width="17">&nbsp;</td>
          <td width="144"><input name="textfield2" type="text" class="informacoesLogin" value="Entrada &agrave;s:  <?php $y = $acesso->getHoraAcesso(); echo("$y"); ?>" readonly="readonly"></td>
          <td width="17">&nbsp;</td>
          <td width="303">
<input name="textfield22" type="text" class="informacoesLogin" value="Data: <?php $z = $acesso->getDataAcesso(); echo("$z"); ?>" readonly="readonly">
          </td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
<?php
}else{
		$msg = new Mensagem();
		$msg->informaMensagem(005,$acesso->getPaginaPrincipal());
	}?>